3.409 \(\int \cos (c+d x) (a+b \cos (c+d x)) \, dx\)

Optimal. Leaf size=38 \[ \frac{a \sin (c+d x)}{d}+\frac{b \sin (c+d x) \cos (c+d x)}{2 d}+\frac{b x}{2} \]

[Out]

(b*x)/2 + (a*Sin[c + d*x])/d + (b*Cos[c + d*x]*Sin[c + d*x])/(2*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0153514, antiderivative size = 38, normalized size of antiderivative = 1., number of steps used = 1, number of rules used = 1, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.059, Rules used = {2734} \[ \frac{a \sin (c+d x)}{d}+\frac{b \sin (c+d x) \cos (c+d x)}{2 d}+\frac{b x}{2} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]*(a + b*Cos[c + d*x]),x]

[Out]

(b*x)/2 + (a*Sin[c + d*x])/d + (b*Cos[c + d*x]*Sin[c + d*x])/(2*d)

Rule 2734

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((2*a*c
+ b*d)*x)/2, x] + (-Simp[((b*c + a*d)*Cos[e + f*x])/f, x] - Simp[(b*d*Cos[e + f*x]*Sin[e + f*x])/(2*f), x]) /;
 FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]

Rubi steps

\begin{align*} \int \cos (c+d x) (a+b \cos (c+d x)) \, dx &=\frac{b x}{2}+\frac{a \sin (c+d x)}{d}+\frac{b \cos (c+d x) \sin (c+d x)}{2 d}\\ \end{align*}

Mathematica [A]  time = 0.0630121, size = 35, normalized size = 0.92 \[ \frac{4 a \sin (c+d x)+b (2 (c+d x)+\sin (2 (c+d x)))}{4 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]*(a + b*Cos[c + d*x]),x]

[Out]

(4*a*Sin[c + d*x] + b*(2*(c + d*x) + Sin[2*(c + d*x)]))/(4*d)

________________________________________________________________________________________

Maple [A]  time = 0.036, size = 38, normalized size = 1. \begin{align*}{\frac{1}{d} \left ( b \left ({\frac{\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2}}+{\frac{dx}{2}}+{\frac{c}{2}} \right ) +a\sin \left ( dx+c \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*(a+b*cos(d*x+c)),x)

[Out]

1/d*(b*(1/2*cos(d*x+c)*sin(d*x+c)+1/2*d*x+1/2*c)+a*sin(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 0.954672, size = 46, normalized size = 1.21 \begin{align*} \frac{{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} b + 4 \, a \sin \left (d x + c\right )}{4 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*cos(d*x+c)),x, algorithm="maxima")

[Out]

1/4*((2*d*x + 2*c + sin(2*d*x + 2*c))*b + 4*a*sin(d*x + c))/d

________________________________________________________________________________________

Fricas [A]  time = 1.79919, size = 72, normalized size = 1.89 \begin{align*} \frac{b d x +{\left (b \cos \left (d x + c\right ) + 2 \, a\right )} \sin \left (d x + c\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*cos(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(b*d*x + (b*cos(d*x + c) + 2*a)*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [A]  time = 0.236868, size = 66, normalized size = 1.74 \begin{align*} \begin{cases} \frac{a \sin{\left (c + d x \right )}}{d} + \frac{b x \sin ^{2}{\left (c + d x \right )}}{2} + \frac{b x \cos ^{2}{\left (c + d x \right )}}{2} + \frac{b \sin{\left (c + d x \right )} \cos{\left (c + d x \right )}}{2 d} & \text{for}\: d \neq 0 \\x \left (a + b \cos{\left (c \right )}\right ) \cos{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*cos(d*x+c)),x)

[Out]

Piecewise((a*sin(c + d*x)/d + b*x*sin(c + d*x)**2/2 + b*x*cos(c + d*x)**2/2 + b*sin(c + d*x)*cos(c + d*x)/(2*d
), Ne(d, 0)), (x*(a + b*cos(c))*cos(c), True))

________________________________________________________________________________________

Giac [A]  time = 1.40161, size = 42, normalized size = 1.11 \begin{align*} \frac{1}{2} \, b x + \frac{b \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac{a \sin \left (d x + c\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*cos(d*x+c)),x, algorithm="giac")

[Out]

1/2*b*x + 1/4*b*sin(2*d*x + 2*c)/d + a*sin(d*x + c)/d